package work20240723;

import java.util.HashMap;
import java.util.Map;

public class work7 {
    public static void main(String[] args) {
        YesOrNo("ppRYYGrrYBR2258","YrR8RrY");
    }
    public static void YesOrNo(String s1,String s2){
        Map<Character,Integer> map1 = new HashMap<>();
        Map<Character,Integer> map2 = new HashMap<>();
        for(int i = 0;i < s1.length();i++){
            if(!map1.containsKey(s1.charAt(i))){
                map1.put(s1.charAt(i),1);
            } else {
                map1.put(s1.charAt(i),map1.get(s1.charAt(i)) + 1);
            }
        }
        for(int i = 0;i < s2.length();i++){
            if(!map2.containsKey(s2.charAt(i))){
                map2.put(s2.charAt(i),1);
            } else {
                map2.put(s2.charAt(i),map2.get(s2.charAt(i)) + 1);
            }
        }
        for(Map.Entry<Character,Integer> m2 : map2.entrySet()){
            for(Map.Entry<Character,Integer> m1 : map1.entrySet()){
                if(m2.getKey() == m1.getKey()){
                    if(m2.getValue() > m1.getValue()){
                        System.out.println("No");
                        return;
                    }
                }
            }
        }
        System.out.println("Yes" + " " + (s1.length() - s2.length()));
    }
}
